﻿
using Test30.Core;

namespace Test30.Engine
{
    public class CreatePortalAction : Action
    {
        public CreatePortalAction(Entity entity)
            : base(entity)
        {
        }

        protected override ActionResult OnProcess()
        {
            if (!Dungeon.TryFindOpenTileWithin(Entity.Position, 4, 12, out var pos))
            {
                return ActionResult.Fail;
            }

            Dungeon.SetTileType(pos, TileType.TownPortal);

            return ActionResult.Done;
        }
    }
}
